package it.desertsupport.model;

public class Role {
	
	private Long idRole;
	private String roleCode;
	private String description;
	
	// Constructors
	public Role() {}

	public Role(String roleCode, String description) {
		super();
		this.roleCode = roleCode;
		this.description = description;
	}

	public Role(Long idRole, String roleCode, String description) {
		this.idRole = idRole;
		this.roleCode = roleCode;
		this.description = description;
	}

	// Getter and Setter
	public Long getIdRole() {
		return this.idRole;
	}
	public void setIdRole(Long idRole) {
		this.idRole = idRole;
	}

	public String getRoleCode() {
		return this.roleCode;
	}
	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}
	
	public String getDescription() {
		return this.description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	// Methods
	@Override
	public String toString() {
		return "Role [idRole=" + idRole + ", roleCode=" + roleCode 
				+ ", description=" + this.description + "]";
	}

	@Override
	public boolean equals(Object object) {
		if(object == null || !(object instanceof Role)){
			return false;
		}
		Role role = (Role) object;
		return role.getIdRole() == this.idRole;
	}

}
